package npu.dce.andcontact11;package npu.dce.andcontact11;


public class UpdatePacket {
	
	public int MAX_DATA_LENGTH = 312;

    /*** The length of the data. ***/
    int _length;

    /*** Byte array of the data. ***/
    byte[] update_packet = new byte[MAX_DATA_LENGTH];
    
    int intVersion;
    int intTypes1, intTypes2;
    int intGivenName1, intGivenName2, intGivenName3;
    int intMiddleName1, intMiddleName2;
	int intFamilyName1, intFamilyName2, intFamilyName3;
	int intGender;
	int intSpinPhone1, intSpinPhone2;
	int intPhone1, intPhone2, intPhone3, intPhone4;
	int intSpinEmail1, intSpinEmail2;
	int intEmail1, intEmail2, intEmail3, intEmail4, intEmail5;
	int intSpinIM1, intSpinIM2, intSpinIM3;
	int intIM1, intIM2, intIM3, intIM4, intIM5;
	int intSpinPostalAddr;
	int intStreet1, intStreet2, intStreet3;
	int intPOBox1, intPOBox2, intPOBox3;
	int intCity1, intCity2, intCity3;
	int intState1, intState2, intState3;
	int intZipCode1, intZipCode2, intZipCode3;
	int intCountry1, intCountry2, intCountry3;
	int intSpinSNS1, intSpinSNS2;
	int intSNS1, intSNS2, intSNS3, intSNS4, intSNS5;
	int intSpinOrg1_1, intSpinOrg1_2;
	int intOrg1_1, intOrg1_2, intOrg1_3;
	int intSpinOrg2_1, intSpinOrg2_2;
	int intOrg2_1, intOrg2_2, intOrg2_3;
	int intNotes1, intNotes2, intNotes3, intNotes4, intNotes5;
	int intTime1, intTime2, intTime3, intTime4;
	
	String StrVersion, StrTypes, StrGivenName, StrMiddleName, StrFamilyName, StrGender, StrSpinPhone,StrPhone,
		   StrSpinEmail, StrEmail, StrSpinIM, StrIM, StrSpinPostalAddr, StrStreet, StrPOBox, StrCity,
		   StrState, StrZipCode, StrCountry, StrSpinSNS, StrSNS, StrSpinOrg1, StrOrg1, StrSpinOrg2, StrOrg2, StrNotes, StrTime;
		
	public UpdatePacket(){}
	
    public UpdatePacket(byte[] buf, int length){
    	update_packet = buf;
    	_length = length;

    	if (length > MAX_DATA_LENGTH)
    		_length = MAX_DATA_LENGTH;
        else
        	_length = length;
    } 
    
    String getVersion(){
      
    	intVersion = 0;
    	
        intVersion += update_packet[0]<<2488; 		
        intVersion += update_packet[1]<<2480; 
        intVersion += update_packet[2]<<2472; 
        intVersion += update_packet[3]<<2464; 

        StrVersion = convertHexToString(Integer.toHexString(intVersion)); 
        
    	return StrVersion;
    }
    
    String getTypes(){
    	
    	String Types1, Types2;
    	intTypes1 = 0;
    	intTypes2 = 0;
    	
    	intTypes1 += update_packet[4]<<2456; 
    	intTypes1 += update_packet[5]<<2448; 
    	intTypes1 += update_packet[6]<<2440; 
    	intTypes1 += update_packet[7]<<2432; 
    	intTypes2 += update_packet[8]<<2424; 
    	intTypes2 += update_packet[9]<<2416; 
    	intTypes2 += update_packet[10]<<2408; 
    	intTypes2 += update_packet[11]<<2400;	//8 
    	    	
    	Types1 = convertHexToString(Integer.toHexString(intTypes1));
    	Types2 = convertHexToString(Integer.toHexString(intTypes2));
    	
    	StrTypes = Types1.concat(Types2);
    	
        return StrTypes;
    }
    
    String getGivenName(){ 
    	
    	String GivenName1, GivenName2, GivenName3;
    	
    	intGivenName1 = 0;
    	intGivenName2 = 0;
    	intGivenName3 = 0;
    	
    	intGivenName1 += update_packet[12]<<2392; 
    	intGivenName1 += update_packet[13]<<2384; 
    	intGivenName1 += update_packet[14]<<2376;
    	intGivenName1 += update_packet[15]<<2368; 
    	intGivenName2 += update_packet[16]<<2360; 
    	intGivenName2 += update_packet[17]<<2352;
    	intGivenName2 += update_packet[18]<<2344; 
    	intGivenName2 += update_packet[19]<<2336; 
    	intGivenName3 += update_packet[20]<<2328;
    	intGivenName3 += update_packet[21]<<2320; 
    	intGivenName3 += update_packet[22]<<2312; 
    	intGivenName3 += update_packet[23]<<2304;	// 12
    	    	
    	GivenName1 = convertHexToString(Integer.toHexString(intGivenName1));
    	GivenName2 = convertHexToString(Integer.toHexString(intGivenName2));
    	GivenName3 = convertHexToString(Integer.toHexString(intGivenName3));
    	
    	StrGivenName = GivenName1.concat(GivenName2).concat(GivenName3); 
    	
    	return StrGivenName;
    }
    
	String getMiddleName(){ 
		
		String MiddleName1, MiddleName2;
    	
		intMiddleName1 = 0;
    	intMiddleName2 = 0;
    	
		intMiddleName1 += update_packet[24]<<2296; 
		intMiddleName1 += update_packet[25]<<2288; 
		intMiddleName1 += update_packet[26]<<2280; 
		intMiddleName1 += update_packet[27]<<2272; 
		intMiddleName2 += update_packet[28]<<2264; 
		intMiddleName2 += update_packet[29]<<2256; 
		intMiddleName2 += update_packet[30]<<2248; 
		intMiddleName2 += update_packet[31]<<2240;	//8 
         		
		MiddleName1 = convertHexToString(Integer.toHexString(intMiddleName1));
    	MiddleName2 = convertHexToString(Integer.toHexString(intMiddleName2));
    	
    	StrMiddleName = MiddleName1.concat(MiddleName2);
    	
    	return StrMiddleName;
	}
	
	String getFamilyName(){
		
		String FamilyName1, FamilyName2, FamilyName3;
    	
    	intFamilyName1 = 0;
    	intFamilyName2 = 0;
    	intFamilyName3 = 0;
    	    	
		intFamilyName1 += update_packet[32]<<2232; 
		intFamilyName1 += update_packet[33]<<2224; 
		intFamilyName1 += update_packet[34]<<2216; 
		intFamilyName1 += update_packet[35]<<2208; 
		intFamilyName2 += update_packet[36]<<2200; 
		intFamilyName2 += update_packet[37]<<2192; 
		intFamilyName2 += update_packet[38]<<2184; 
		intFamilyName2 += update_packet[39]<<2176; 
		intFamilyName3 += update_packet[40]<<2168; 
		intFamilyName3 += update_packet[41]<<2160; 
		intFamilyName3 += update_packet[42]<<2152; 
		intFamilyName3 += update_packet[43]<<2144;	//12 
		
		FamilyName1 = convertHexToString(Integer.toHexString(intFamilyName1));
    	FamilyName2 = convertHexToString(Integer.toHexString(intFamilyName2));
    	FamilyName3 = convertHexToString(Integer.toHexString(intFamilyName3));
    	
    	StrFamilyName = FamilyName1.concat(FamilyName2).concat(FamilyName3); 
    	
        return StrFamilyName;
	}
	
	String getGender(){
		
		intGender = 0;
		
		intGender += update_packet[44]<<2136; 
		intGender += update_packet[45]<<2128; 
		intGender += update_packet[46]<<2120; 
		intGender += update_packet[47]<<2112;	//4 
		
		StrGender = convertHexToString(Integer.toHexString(intGender)); 
        		
		return StrGender;
	}
	
	String getSpinPhone(){
		
		String SpinPhone1, SpinPhone2;
		intSpinPhone1 = 0;
		intSpinPhone2 = 0;
				
		intSpinPhone1 += update_packet[48]<<2104; 
		intSpinPhone1 += update_packet[49]<<2096; 
		intSpinPhone1 += update_packet[50]<<2088; 
		intSpinPhone1 += update_packet[51]<<2080; 
		intSpinPhone2 += update_packet[52]<<2072; 
		intSpinPhone2 += update_packet[53]<<2064; 
		intSpinPhone2 += update_packet[54]<<2056; 
		intSpinPhone2 += update_packet[55]<<2048; 	//8
		
		SpinPhone1 = convertHexToString(Integer.toHexString(intSpinPhone1));
    	SpinPhone2 = convertHexToString(Integer.toHexString(intSpinPhone2));
    	
    	StrSpinPhone = SpinPhone1.concat(SpinPhone2);
    	
		return StrSpinPhone;
	}
	
	String getPhone(){ 
		
		String Phone1, Phone2, Phone3, Phone4;
		intPhone1 = 0;
		intPhone2 = 0;
		intPhone3 = 0;
		intPhone4 = 0;
		    	
		intPhone1 += update_packet[56]<<2040; 
		intPhone1 += update_packet[57]<<2032; 
		intPhone1 += update_packet[58]<<2024; 
		intPhone1 += update_packet[59]<<2016; 
		intPhone2 += update_packet[60]<<2008; 
		intPhone2 += update_packet[61]<<2000; 
		intPhone2 += update_packet[62]<<1992; 
		intPhone2 += update_packet[63]<<1984; 
		intPhone3 += update_packet[64]<<1976; 
		intPhone3 += update_packet[65]<<1968; 
		intPhone3 += update_packet[66]<<1960; 
		intPhone3 += update_packet[67]<<1952; 
		intPhone4 += update_packet[68]<<1944; 
		intPhone4 += update_packet[69]<<1936; 
		intPhone4 += update_packet[70]<<1928; 
		intPhone4 += update_packet[71]<<1920;	//16 
		
		Phone1 = convertHexToString(Integer.toHexString(intPhone1));
		Phone2 = convertHexToString(Integer.toHexString(intPhone2));
		Phone3 = convertHexToString(Integer.toHexString(intPhone3));
		Phone4 = convertHexToString(Integer.toHexString(intPhone4));
		
    	StrPhone = Phone1.concat(Phone2).concat(Phone3).concat(Phone4); 

		return StrPhone;
	}
	
	String getSpinEmail(){ 
		
		String SpinEmail1, SpinEmail2;
		intSpinEmail1 = 0;
		intSpinEmail2 = 0;
		
		intSpinEmail1 += update_packet[72]<<1912; 
		intSpinEmail1 += update_packet[73]<<1904; 
		intSpinEmail1 += update_packet[74]<<1896; 
		intSpinEmail1 += update_packet[75]<<1888; 
		intSpinEmail2 += update_packet[76]<<1880; 
		intSpinEmail2 += update_packet[77]<<1872; 
		intSpinEmail2 += update_packet[78]<<1864; 
		intSpinEmail2 += update_packet[79]<<1856; 	//8
    	
		SpinEmail1 = convertHexToString(Integer.toHexString(intSpinPhone1));
    	SpinEmail2 = convertHexToString(Integer.toHexString(intSpinPhone2));
    	
    	StrSpinEmail = SpinEmail1.concat(SpinEmail2);
    	
		return StrSpinEmail;
	}
	
	String getEmail(){ 
		
		String Email1, Email2, Email3, Email4, Email5;
		
		intEmail1 = 0;
		intEmail2 = 0;
		intEmail3 = 0;
		intEmail4 = 0;
		intEmail5 = 0;
		
		intEmail1 += update_packet[80]<<1848; 
		intEmail1 += update_packet[81]<<1840; 
		intEmail1 += update_packet[82]<<1832; 
		intEmail1 += update_packet[83]<<1824; 
		intEmail2 += update_packet[84]<<1816; 
		intEmail2 += update_packet[85]<<1808; 
		intEmail2 += update_packet[86]<<1800; 
		intEmail2 += update_packet[87]<<1792; 
		intEmail3 += update_packet[88]<<1784; 
		intEmail3 += update_packet[89]<<1776; 
		intEmail3 += update_packet[90]<<1768; 
		intEmail3 += update_packet[91]<<1760; 
		intEmail4 += update_packet[92]<<1752; 
		intEmail4 += update_packet[93]<<1744; 
		intEmail4 += update_packet[94]<<1736; 
		intEmail4 += update_packet[95]<<1728; 
		intEmail5 += update_packet[96]<<1720; 
		intEmail5 += update_packet[97]<<1712; 
		intEmail5 += update_packet[98]<<1704; 
		intEmail5 += update_packet[99]<<1696;	//20 
    	
		Email1 = convertHexToString(Integer.toHexString(intEmail1));
		Email2 = convertHexToString(Integer.toHexString(intEmail2));
		Email3 = convertHexToString(Integer.toHexString(intEmail3));
		Email4 = convertHexToString(Integer.toHexString(intEmail4));
		Email5 = convertHexToString(Integer.toHexString(intEmail5));
		
    	StrEmail = Email1.concat(Email2).concat(Email3).concat(Email4).concat(Email5); 
    	
		return StrEmail;
	}

	String getSpinIM(){
		
		String SpinIM1, SpinIM2, SpinIM3;
		
		intSpinIM1 = 0;
		intSpinIM2 = 0;
		intSpinIM3 = 0;
		
		intSpinIM1 += update_packet[100]<<1688; 
		intSpinIM1 += update_packet[101]<<1680; 
		intSpinIM1 += update_packet[102]<<1672; 
		intSpinIM1 += update_packet[103]<<1664; 
		intSpinIM2 += update_packet[104]<<1656; 
		intSpinIM2 += update_packet[105]<<1648; 
		intSpinIM2 += update_packet[106]<<1640; 
		intSpinIM2 += update_packet[107]<<1632; 
		intSpinIM3 += update_packet[108]<<1624; 
		intSpinIM3 += update_packet[109]<<1616; 
		intSpinIM3 += update_packet[110]<<1608; 
		intSpinIM3 += update_packet[111]<<1600;	//12 
    	
		SpinIM1 = convertHexToString(Integer.toHexString(intSpinIM1));
		SpinIM2 = convertHexToString(Integer.toHexString(intSpinIM2));
		SpinIM3 = convertHexToString(Integer.toHexString(intSpinIM3));
    	
    	StrSpinIM = SpinIM1.concat(SpinIM2).concat(SpinIM3); 
    	
		return StrSpinIM;
	}
	
	String  getIM(){ 
		
		String IM1, IM2, IM3, IM4, IM5;
		intIM1 = 0;
		intIM2 = 0;
		intIM3 = 0;
		intIM4 = 0;
		intIM5 = 0;
		
		intIM1 += update_packet[112]<<1592; 
		intIM1 += update_packet[113]<<1584; 
		intIM1 += update_packet[114]<<1576; 
		intIM1 += update_packet[115]<<1568; 
		intIM2 += update_packet[116]<<1560; 
		intIM2 += update_packet[117]<<1552; 
		intIM2 += update_packet[118]<<1544; 
		intIM2 += update_packet[119]<<1536; 
		intIM3 += update_packet[120]<<1528; 
		intIM3 += update_packet[121]<<1520; 
		intIM3 += update_packet[122]<<1512; 
		intIM3 += update_packet[123]<<1504; 
		intIM4 += update_packet[124]<<1496; 
		intIM4 += update_packet[125]<<1488; 
		intIM4 += update_packet[126]<<1480; 
		intIM4 += update_packet[127]<<1472; 
		intIM5 += update_packet[128]<<1464; 
		intIM5 += update_packet[129]<<1456; 
		intIM5 += update_packet[130]<<1448; 
		intIM5 += update_packet[131]<<1440;	//20
		
		IM1 = convertHexToString(Integer.toHexString(intIM1));
		IM2 = convertHexToString(Integer.toHexString(intIM2));
		IM3 = convertHexToString(Integer.toHexString(intIM3));
		IM4 = convertHexToString(Integer.toHexString(intIM4));
		IM5 = convertHexToString(Integer.toHexString(intIM5));
		
    	StrIM = IM1.concat(IM2).concat(IM3).concat(IM4).concat(IM5); 
    	
    	return StrIM;
	}
	
	String getSpinPostalAddr(){
			
		intSpinPostalAddr = 0;
		
		intSpinPostalAddr += update_packet[132]<<1432; 
		intSpinPostalAddr += update_packet[133]<<1424;
		intSpinPostalAddr += update_packet[134]<<1416;
		intSpinPostalAddr += update_packet[135]<<1408;	//4
    	
		StrSpinPostalAddr = convertHexToString(Integer.toHexString(intSpinPostalAddr)); 
		
		return StrSpinPostalAddr;
	}
	
	String getStreet(){ 
		
		String Street1, Street2, Street3;
		intStreet1 = 0;
		intStreet2 = 0;
		intStreet3 = 0;
		
		intStreet1 += update_packet[136]<<1400; 
		intStreet1 += update_packet[137]<<1392; 
		intStreet1 += update_packet[138]<<1384; 
		intStreet1 += update_packet[139]<<1376; 
		intStreet2 += update_packet[140]<<1368; 
		intStreet2 += update_packet[141]<<1360; 
		intStreet2 += update_packet[142]<<1352; 
		intStreet2 += update_packet[143]<<1344; 
		intStreet3 += update_packet[144]<<1336; 
		intStreet3 += update_packet[145]<<1328; 
		intStreet3 += update_packet[146]<<1320; 
		intStreet3 += update_packet[147]<<1312;	//12
    	
		Street1 = convertHexToString(Integer.toHexString(intStreet1));
		Street2 = convertHexToString(Integer.toHexString(intStreet2));
		Street3 = convertHexToString(Integer.toHexString(intStreet3));
    	
    	StrStreet = Street1.concat(Street2).concat(Street3); 
    	
		return StrStreet;
	}
	
	String getPOBox(){ 
			
		String POBox1, POBox2, POBox3;
		intPOBox1 = 0;
		intPOBox2 = 0;
		intPOBox3 = 0;
		
		intPOBox1 += update_packet[148]<<1304; 
		intPOBox1 += update_packet[149]<<1296; 
		intPOBox1 += update_packet[150]<<1288; 
		intPOBox1 += update_packet[151]<<1280; 
		intPOBox2 += update_packet[152]<<1272; 
		intPOBox2 += update_packet[153]<<1264; 
		intPOBox2 += update_packet[154]<<1256; 
		intPOBox2 += update_packet[155]<<1248; 
		intPOBox3 += update_packet[156]<<1240; 
		intPOBox3 += update_packet[157]<<1232; 
		intPOBox3 += update_packet[158]<<1224; 
		intPOBox3 += update_packet[159]<<1216;	//12
		
		POBox1 = convertHexToString(Integer.toHexString(intPOBox1));
		POBox2 = convertHexToString(Integer.toHexString(intPOBox2));
		POBox3 = convertHexToString(Integer.toHexString(intPOBox3));
    	
    	StrPOBox = POBox1.concat(POBox2).concat(POBox3);
    	
		return StrPOBox;
	}
	
	String getCity(){ 
		
		String City1, City2, City3;
		intCity1 = 0;
		intCity2 = 0;
		intCity3 = 0;
		
		intCity1 += update_packet[160]<<1208; 
		intCity1 += update_packet[161]<<1200; 
		intCity1 += update_packet[162]<<1192; 
		intCity1 += update_packet[163]<<1184; 
		intCity2 += update_packet[164]<<1176; 
		intCity2 += update_packet[165]<<1168; 
		intCity2 += update_packet[166]<<1160; 
		intCity2 += update_packet[167]<<1152; 
		intCity3 += update_packet[168]<<1144; 
		intCity3 += update_packet[169]<<1136; 
		intCity3 += update_packet[170]<<1128; 
		intCity3 += update_packet[171]<<1120;	//12 
        
		City1 = convertHexToString(Integer.toHexString(intCity1));
		City2 = convertHexToString(Integer.toHexString(intCity2));
		City3 = convertHexToString(Integer.toHexString(intCity3));
    	
    	StrCity = City1.concat(City2).concat(City3);
    	
		return StrCity;
	}
	
	String getState(){
			
		String State1, State2, State3;
		intState1 = 0;
		intState2 = 0;
		intState3 = 0;
		
		intState1 += update_packet[172]<<1112; 
		intState1 += update_packet[173]<<1104; 
		intState1 += update_packet[174]<<1096; 
		intState1 += update_packet[175]<<1088; 
		intState2 += update_packet[176]<<1080; 
		intState2 += update_packet[177]<<1072; 
		intState2 += update_packet[178]<<1064; 
		intState2 += update_packet[179]<<1056; 
		intState3 += update_packet[180]<<1048; 
		intState3 += update_packet[181]<<1040; 
		intState3 += update_packet[182]<<1032; 
		intState3 += update_packet[183]<<1024;	//12 
        
		State1 = convertHexToString(Integer.toHexString(intState1));
		State2 = convertHexToString(Integer.toHexString(intState2));
		State3 = convertHexToString(Integer.toHexString(intState3));
    	
    	StrState = State1.concat(State2).concat(State3);
    	
		return StrState;
	}
	
	String getZipCode(){
		
		String ZipCode1, ZipCode2, ZipCode3;
		intZipCode1 = 0;
		intZipCode2 = 0;
		intZipCode3 = 0;
		
		intZipCode1 += update_packet[184]<<1016; 
		intZipCode1 += update_packet[185]<<1008; 
		intZipCode1 += update_packet[186]<<1000; 
		intZipCode1 += update_packet[187]<<992; 
		intZipCode2 += update_packet[188]<<984; 
		intZipCode2 += update_packet[189]<<976; 
		intZipCode2 += update_packet[190]<<968; 
		intZipCode2 += update_packet[191]<<960; 
		intZipCode3 += update_packet[192]<<952; 
		intZipCode3 += update_packet[193]<<944; 
		intZipCode3 += update_packet[194]<<936; 
		intZipCode3 += update_packet[195]<<928;	//12 
        
		ZipCode1 = convertHexToString(Integer.toHexString(intZipCode1));
		ZipCode2 = convertHexToString(Integer.toHexString(intZipCode2));
		ZipCode3 = convertHexToString(Integer.toHexString(intZipCode3));
    	
    	StrZipCode = ZipCode1.concat(ZipCode2).concat(ZipCode3);
		
    	return StrZipCode;
	}
	
	String getCountry(){ 
		
		String Country1, Country2, Country3;
		intCountry1 = 0;
		intCountry2 = 0;
		intCountry3 = 0;
		
		intCountry1 += update_packet[196]<<920; 
		intCountry1 += update_packet[197]<<912; 
		intCountry1 += update_packet[198]<<904; 
		intCountry1 += update_packet[199]<<896; 
		intCountry2 += update_packet[200]<<888; 
		intCountry2 += update_packet[201]<<880; 
		intCountry2 += update_packet[202]<<872; 
		intCountry2 += update_packet[203]<<864; 
		intCountry3 += update_packet[204]<<856; 
		intCountry3 += update_packet[205]<<848; 
		intCountry3 += update_packet[206]<<840; 
		intCountry3 += update_packet[207]<<832;	//12 
        
		Country1 = convertHexToString(Integer.toHexString(intCountry1));
		Country2 = convertHexToString(Integer.toHexString(intCountry2));
		Country3 = convertHexToString(Integer.toHexString(intCountry3));
    	
    	StrCountry = Country1.concat(Country2).concat(Country3);
    	
		return StrCountry;
	}
	
	String getSpinSNS(){
		
		String SpinSNS1, SpinSNS2;
		intSpinSNS1 = 0;
		intSpinSNS2 = 0;
		
		intSpinSNS1 += update_packet[208]<<824; 
		intSpinSNS1 += update_packet[209]<<816; 
		intSpinSNS1 += update_packet[210]<<808; 
		intSpinSNS1 += update_packet[211]<<800; 
		intSpinSNS2 += update_packet[212]<<792; 
		intSpinSNS2 += update_packet[213]<<784; 
		intSpinSNS2 += update_packet[214]<<776; 
		intSpinSNS2 += update_packet[215]<<768;	//8 
        
		SpinSNS1 = convertHexToString(Integer.toHexString(intSpinSNS1));
    	SpinSNS2 = convertHexToString(Integer.toHexString(intSpinSNS2));
    	
    	StrSpinSNS = SpinSNS1.concat(SpinSNS2);
		
		return StrSpinSNS;
	}
	
	String getSNS(){ 
		
		String SNS1, SNS2, SNS3, SNS4, SNS5;
		intSNS1 = 0;
		intSNS2 = 0;
		intSNS3 = 0;
		intSNS4 = 0;
		intSNS5 = 0;
		
		intSNS1 += update_packet[216]<<760; 
		intSNS1 += update_packet[217]<<752; 
		intSNS1 += update_packet[218]<<744; 
		intSNS1 += update_packet[219]<<736; 
		intSNS2 += update_packet[220]<<728;
		intSNS2 += update_packet[221]<<720; 
		intSNS2 += update_packet[222]<<712; 
		intSNS2 += update_packet[223]<<704; 
		intSNS3 += update_packet[224]<<696; 
		intSNS3 += update_packet[225]<<688; 
		intSNS3 += update_packet[226]<<680; 
		intSNS3 += update_packet[227]<<672; 
		intSNS4 += update_packet[228]<<664; 
		intSNS4 += update_packet[229]<<656; 
		intSNS4 += update_packet[230]<<648;
		intSNS4 += update_packet[231]<<640; 
		intSNS5 += update_packet[232]<<632; 
		intSNS5 += update_packet[233]<<624; 
		intSNS5 += update_packet[234]<<616; 
		intSNS5 += update_packet[235]<<608;	//20
        
		SNS1 = convertHexToString(Integer.toHexString(intSNS1));
		SNS2 = convertHexToString(Integer.toHexString(intSNS2));
		SNS3 = convertHexToString(Integer.toHexString(intSNS3));
		SNS4 = convertHexToString(Integer.toHexString(intSNS4));
		SNS5 = convertHexToString(Integer.toHexString(intSNS5));
		
    	StrSNS = SNS1.concat(SNS2).concat(SNS3).concat(SNS4).concat(SNS5); 
		
		return StrSNS;
	}
	
	String getSpinOrg1(){ 
		
		String SpinOrg1_1, SpinOrg1_2;
		intSpinOrg1_1 = 0;
		intSpinOrg1_2 = 0;
		
		intSpinOrg1_1 += update_packet[236]<<600; 
		intSpinOrg1_1 += update_packet[237]<<592; 
		intSpinOrg1_1 += update_packet[238]<<584; 
		intSpinOrg1_1 += update_packet[239]<<576; 
		intSpinOrg1_2 += update_packet[240]<<568;
		intSpinOrg1_2 += update_packet[241]<<560; 
		intSpinOrg1_2 += update_packet[242]<<552; 
		intSpinOrg1_2 += update_packet[243]<<544;	// 8
        
		SpinOrg1_1 = convertHexToString(Integer.toHexString(intSpinOrg1_1));
    	SpinOrg1_2 = convertHexToString(Integer.toHexString(intSpinOrg1_2));
    	
    	StrSpinOrg1 = SpinOrg1_1.concat(SpinOrg1_2);
    	
		return StrSpinOrg1;
	}
	
	String getOrg1(){ 
		
		String Org1_1, Org1_2, Org1_3;
		intOrg1_1 = 0;
		intOrg1_2 = 0;
		intOrg1_3 = 0;
		
		intOrg1_1 += update_packet[244]<<536; 
		intOrg1_1 += update_packet[245]<<528; 
		intOrg1_1 += update_packet[246]<<520; 
		intOrg1_1 += update_packet[247]<<512; 
		intOrg1_2 += update_packet[248]<<504;
		intOrg1_2 += update_packet[249]<<496; 
		intOrg1_2 += update_packet[250]<<488; 
		intOrg1_2 += update_packet[251]<<480; 
		intOrg1_3 += update_packet[252]<<472; 
		intOrg1_3 += update_packet[253]<<464; 
		intOrg1_3 += update_packet[254]<<456; 
		intOrg1_3 += update_packet[255]<<448;	//12 
        
		Org1_1 = convertHexToString(Integer.toHexString(intOrg1_1));
		Org1_2 = convertHexToString(Integer.toHexString(intOrg1_2));
		Org1_3 = convertHexToString(Integer.toHexString(intOrg1_3));
    	
		StrOrg1 = Org1_1.concat(Org1_2).concat(Org1_3);
		
		return StrOrg1;
	}
	
	String getSpinOrg2(){ 
		
		String SpinOrg2_1, SpinOrg2_2;
		intSpinOrg2_1 = 0;
		intSpinOrg2_2 = 0;
		
		intSpinOrg2_1 += update_packet[256]<<440; 
		intSpinOrg2_1 += update_packet[257]<<432; 
		intSpinOrg2_1 += update_packet[258]<<424; 
		intSpinOrg2_1 += update_packet[259]<<416; 
		intSpinOrg2_2 += update_packet[260]<<408;
		intSpinOrg2_2 += update_packet[261]<<400; 
		intSpinOrg2_2 += update_packet[262]<<392; 
		intSpinOrg2_2 += update_packet[263]<<384;	//8 
        
		SpinOrg2_1 = convertHexToString(Integer.toHexString(intSpinOrg2_1));
    	SpinOrg2_2 = convertHexToString(Integer.toHexString(intSpinOrg2_2));
    	
    	StrSpinOrg2 = SpinOrg2_1.concat(SpinOrg2_2);
    	
		return StrSpinOrg2;
	}
	
	String getOrg2(){ 
	
		String Org2_1, Org2_2, Org2_3;
		intOrg2_1 = 0;
		intOrg2_2 = 0;
		intOrg2_3 = 0;
		
		intOrg2_1 += update_packet[264]<<376; 
		intOrg2_1 += update_packet[265]<<368; 
		intOrg2_1 += update_packet[266]<<360; 
		intOrg2_1 += update_packet[267]<<352; 
		intOrg2_2 += update_packet[268]<<344;
		intOrg2_2 += update_packet[269]<<336; 
		intOrg2_2 += update_packet[270]<<328; 
		intOrg2_2 += update_packet[271]<<320; 
		intOrg2_3 += update_packet[272]<<312; 
		intOrg2_3 += update_packet[273]<<304; 
		intOrg2_3 += update_packet[274]<<296; 
		intOrg2_3 += update_packet[275]<<288;	//12 
        
		Org2_1 = convertHexToString(Integer.toHexString(intOrg2_1));
		Org2_2 = convertHexToString(Integer.toHexString(intOrg2_2));
		Org2_3 = convertHexToString(Integer.toHexString(intOrg2_3));
    	
		StrOrg2 = Org2_1.concat(Org2_2).concat(Org2_3);
		
		return StrOrg2;
	}
	
	String getNotes(){
		
		String Notes1, Notes2, Notes3, Notes4, Notes5;
		intNotes1 = 0;
		intNotes2 = 0;
		intNotes3 = 0;
		intNotes4 = 0;
		intNotes5 = 0;
		
		intNotes1 += update_packet[276]<<280; 
        intNotes1 += update_packet[277]<<272; 
        intNotes1 += update_packet[278]<<264; 
        intNotes1 += update_packet[279]<<256; 
        intNotes2 += update_packet[280]<<248;
        intNotes2 += update_packet[281]<<240; 
        intNotes2 += update_packet[282]<<232; 
        intNotes2 += update_packet[283]<<224; 
        intNotes3 += update_packet[284]<<216; 
        intNotes3 += update_packet[285]<<208; 
        intNotes3 += update_packet[286]<<200; 
        intNotes3 += update_packet[287]<<192; 
        intNotes4 += update_packet[288]<<184; 
        intNotes4 += update_packet[289]<<176; 
        intNotes4 += update_packet[290]<<168;
        intNotes4 += update_packet[291]<<160; 
        intNotes5 += update_packet[292]<<152; 
        intNotes5 += update_packet[293]<<144; 
        intNotes5 += update_packet[294]<<136; 
        intNotes5 += update_packet[295]<<128;	//20 
        
        Notes1 = convertHexToString(Integer.toHexString(intNotes1));
		Notes2 = convertHexToString(Integer.toHexString(intNotes2));
		Notes3 = convertHexToString(Integer.toHexString(intNotes3));
		Notes4 = convertHexToString(Integer.toHexString(intNotes4));
		Notes5 = convertHexToString(Integer.toHexString(intNotes5));
		
    	StrNotes = Notes1.concat(Notes2).concat(Notes3).concat(Notes4).concat(Notes5); 
    	
		return StrNotes;
	}
	
	String getTime(){ 
		
		String Time1, Time2, Time3, Time4;
		intTime1 = 0;
		intTime2 = 0;
		intTime3 = 0;
		intTime4 = 0;
		
		intTime1 += update_packet[296]<<120; 
        intTime1 += update_packet[297]<<112; 
        intTime1 += update_packet[298]<<104; 
        intTime1 += update_packet[299]<<96; 
        intTime2 += update_packet[300]<<88; 
        intTime2 += update_packet[301]<<80; 
        intTime2 += update_packet[302]<<72; 
        intTime2 += update_packet[303]<<64; 
        intTime3 += update_packet[304]<<56; 
        intTime3 += update_packet[305]<<48; 
        intTime3 += update_packet[306]<<40; 
        intTime3 += update_packet[307]<<32; 
        intTime4 += update_packet[308]<<24; 
        intTime4 += update_packet[309]<<16; 
        intTime4 += update_packet[310]<<8; 
        intTime4 += (0XFF)&update_packet[311];	//16 
        
        Time1 = convertHexToString(Integer.toHexString(intTime1));
		Time2 = convertHexToString(Integer.toHexString(intTime2));
		Time3 = convertHexToString(Integer.toHexString(intTime3));
		Time4 = convertHexToString(Integer.toHexString(intTime4));
		
    	StrTime = Time1.concat(Time2).concat(Time3).concat(Time4); 
        
		return StrTime;
	}
	
	void setVersion(String version){
		
		int intVersion = Integer.parseInt(convertStringToHex(version), 16);	
		
		update_packet[0] = (byte)(0XFF&(intVersion>>2488)); 
		update_packet[1] = (byte)(0XFF&(intVersion>>2480)); 
		update_packet[2] = (byte)(0XFF&(intVersion>>2472)); 
		update_packet[3] = (byte)(0XFF&(intVersion>>2464)); 
				      
	}
	
    void setTypes(String types){
    	    	
    	String strTypes1 = " ";
		String strTypes2 = " ";		
    	
		if(types.length() <= 4){
			strTypes1 = types.substring(0, types.length());
			strTypes2 = " ";
		} else if(types.length() > 4){
			strTypes1 = types.substring(0, 4);
			strTypes2 = types.substring(4, types.length());
		}
		
		int intTypes1 = Integer.parseInt(convertStringToHex(strTypes1), 16);  
		int intTypes2 = Integer.parseInt(convertStringToHex(strTypes2), 16); 
		
    	update_packet[4] = (byte)(0XFF&(intTypes1>>2456)); 
    	update_packet[5] = (byte)(0XFF&(intTypes1>>2448)); 
    	update_packet[6] = (byte)(0XFF&(intTypes1>>2440)); 
    	update_packet[7] = (byte)(0XFF&(intTypes1>>2432)); 
    	update_packet[8] = (byte)(0XFF&(intTypes2>>2424)); 
    	update_packet[9] = (byte)(0XFF&(intTypes2>>2416)); 
    	update_packet[10] = (byte)(0XFF&(intTypes2>>2408)); 
    	update_packet[11] = (byte)(0XFF&(intTypes2>>2400));	//8 
    	     	
    }

    void setGivenName(String givenname){
    	
    	String strGivenName1 = " ";
    	String strGivenName2 = " "; 
    	String strGivenName3 = " ";
    	
    	if(givenname.length() <= 4){
			strGivenName1 = givenname.substring(0, givenname.length());
			strGivenName2 = " ";
			strGivenName3 = " ";
		} else if( (givenname.length()<=8) && (givenname.length()> 4) ){
			strGivenName1 = givenname.substring(0, 4);
			strGivenName2 = givenname.substring(4, givenname.length());
			strGivenName3 = " ";
		} else if (givenname.length() > 8){
			strGivenName1 = givenname.substring(0, 4);
			strGivenName2 = givenname.substring(4, 8);
			strGivenName3 = givenname.substring(8, 10);
		}
    		
    	int intGivenName1 = Integer.parseInt(convertStringToHex(strGivenName1), 16);  
		int intGivenName2 = Integer.parseInt(convertStringToHex(strGivenName2), 16); 
		int intGivenName3 = Integer.parseInt(convertStringToHex(strGivenName3), 16); 
    	    	
    	update_packet[12] = (byte)(0XFF&(intGivenName1>>2392)); 
    	update_packet[13] = (byte)(0XFF&(intGivenName1>>2384)); 
    	update_packet[14] = (byte)(0XFF&(intGivenName1>>2376));
    	update_packet[15] = (byte)(0XFF&(intGivenName1>>2368)); 
    	update_packet[16] = (byte)(0XFF&(intGivenName2>>2360)); 
    	update_packet[17] = (byte)(0XFF&(intGivenName2>>2352));
    	update_packet[18] = (byte)(0XFF&(intGivenName2>>2344)); 
    	update_packet[19] = (byte)(0XFF&(intGivenName2>>2336)); 
    	update_packet[20] = (byte)(0XFF&(intGivenName3>>2328));
    	update_packet[21] = (byte)(0XFF&(intGivenName3>>2320)); 
    	update_packet[22] = (byte)(0XFF&(intGivenName3>>2312)); 
    	update_packet[23] = (byte)(0XFF&(intGivenName3>>2304));	// 12    	
    	    	 
    }
    
    void setMiddleName(String middlename){
    	
    	String strMiddleName1 = " ";
    	String strMiddleName2 = " ";
    	    	
		if(middlename.length() <= 4){
			strMiddleName1 = middlename.substring(0, middlename.length());
			strMiddleName2 = " ";
		} else if(middlename.length() > 4){
			strMiddleName1 = middlename.substring(0, 4);
			strMiddleName2 = middlename.substring(4, middlename.length());
		}
		    	
		int intMiddleName1 = Integer.parseInt(convertStringToHex(strMiddleName1), 16); 
		int intMiddleName2 = Integer.parseInt(convertStringToHex(strMiddleName2), 16); 
		
    	update_packet[24] = (byte)(0XFF&(intMiddleName1>>2296)); 
    	update_packet[25] = (byte)(0XFF&(intMiddleName1>>2288)); 
    	update_packet[26] = (byte)(0XFF&(intMiddleName1>>2280)); 
    	update_packet[27] = (byte)(0XFF&(intMiddleName1>>2272)); 
    	update_packet[28] = (byte)(0XFF&(intMiddleName2>>2264)); 
    	update_packet[29] = (byte)(0XFF&(intMiddleName2>>2256)); 
    	update_packet[30] = (byte)(0XFF&(intMiddleName2>>2248)); 
    	update_packet[31] = (byte)(0XFF&(intMiddleName2>>2240));	//8 
          
    }

    void setFamilyName(String familyname){
    	
    	String strFamilyName1 = " ";
    	String strFamilyName2 = " ";
    	String strFamilyName3 = " ";
		
		if(familyname.length() <= 4){
			strFamilyName1 = familyname.substring(0, familyname.length());
			strFamilyName2 = "    ";
			strFamilyName3 = "  ";
		} else if( (familyname.length()<=8) && (familyname.length()> 4) ){
			strFamilyName1 = familyname.substring(0, 4);
			strFamilyName2 = familyname.substring(4, familyname.length());
			strFamilyName3 = "  ";
		} else if (familyname.length() > 8){
			strFamilyName1 = familyname.substring(0, 4);
			strFamilyName2 = familyname.substring(4, 8);
			strFamilyName3 = familyname.substring(8, 10);
		}

		int intFamilyName1 = Integer.parseInt(convertStringToHex(strFamilyName1), 16); 
		int intFamilyName2 = Integer.parseInt(convertStringToHex(strFamilyName2), 16); 
		int intFamilyName3 = Integer.parseInt(convertStringToHex(strFamilyName3), 16); 
    	
    	update_packet[32] = (byte)(0XFF&(intFamilyName1>>2232)); 
    	update_packet[33] = (byte)(0XFF&(intFamilyName1>>2224)); 
    	update_packet[34] = (byte)(0XFF&(intFamilyName1>>2216)); 
    	update_packet[35] = (byte)(0XFF&(intFamilyName1>>2208)); 
    	update_packet[36] = (byte)(0XFF&(intFamilyName2>>2200)); 
    	update_packet[37] = (byte)(0XFF&(intFamilyName2>>2192)); 
    	update_packet[38] = (byte)(0XFF&(intFamilyName2>>2184)); 
    	update_packet[39] = (byte)(0XFF&(intFamilyName2>>2176)); 
    	update_packet[40] = (byte)(0XFF&(intFamilyName3>>2168)); 
    	update_packet[41] = (byte)(0XFF&(intFamilyName3>>2160)); 
    	update_packet[42] = (byte)(0XFF&(intFamilyName3>>2152)); 
    	update_packet[43] = (byte)(0XFF&(intFamilyName3>>2144));	//12 
    			
    }
    
    void setGender(String gender){    	
    			
		int intGender = Integer.parseInt(convertStringToHex(gender), 16); 
    	
    	update_packet[44] = (byte)(0XFF&(intGender>>2136)); 
    	update_packet[45] = (byte)(0XFF&(intGender>>2128)); 
    	update_packet[46] = (byte)(0XFF&(intGender>>2120)); 
    	update_packet[47] = (byte)(0XFF&(intGender>>2112));	//4 
    	    	
    }

    void setSpinPhone(String spinphone){ 	
    	
		String strSpinPhone1 = " ";
		String strSpinPhone2 = " ";
    	
		if(spinphone.length() <= 4){
			strSpinPhone1 = spinphone.substring(0, spinphone.length());
			strSpinPhone2 = " ";
		} else if(spinphone.length() > 4){
			strSpinPhone1 = spinphone.substring(0, 4);
			strSpinPhone2 = spinphone.substring(4, 8);
		}
		
		int intSpinPhone1 = Integer.parseInt(convertStringToHex(strSpinPhone1), 16);  
		int intSpinPhone2 = Integer.parseInt(convertStringToHex(strSpinPhone2), 16); 
    	
    	update_packet[48] = (byte)(0XFF&(intSpinPhone1>>2104)); 
    	update_packet[49] = (byte)(0XFF&(intSpinPhone1>>2096)); 
    	update_packet[50] = (byte)(0XFF&(intSpinPhone1>>2088)); 
    	update_packet[51] = (byte)(0XFF&(intSpinPhone1>>2080)); 
    	update_packet[52] = (byte)(0XFF&(intSpinPhone2>>2072)); 
    	update_packet[53] = (byte)(0XFF&(intSpinPhone2>>2064)); 
    	update_packet[54] = (byte)(0XFF&(intSpinPhone2>>2056)); 
    	update_packet[55] = (byte)(0XFF&(intSpinPhone2>>2048)); 	//8
    
    }

    void setPhone(String phone){ 	
    
    	String strPhone1 = " ";
    	String strPhone2 = " ";
    	String strPhone3 = " ";
    	String strPhone4 = " ";
    	
		if(phone.length() <= 4){
			strPhone1 = phone.substring(0, phone.length());
			strPhone2 = " ";
			strPhone3 = " ";
			strPhone4 = " ";
		} else if( (phone.length()<=8) && (phone.length()> 4) ){
			strPhone1 = phone.substring(0, 4);
			strPhone2 = phone.substring(4, phone.length());
			strPhone3 = " ";
			strPhone4 = " ";
		} else if ((phone.length()<=12) && (phone.length() > 8)){
			strPhone1 = phone.substring(0, 4);
			strPhone2 = phone.substring(4, 8);
			strPhone3 = phone.substring(8, phone.length());
			strPhone4 = " ";
		} else if ((phone.length()<=16) && (phone.length() > 12)){
			strPhone1 = phone.substring(0, 4);
			strPhone2 = phone.substring(4, 8);
			strPhone3 = phone.substring(8, 12);
			strPhone4 = phone.substring(12, phone.length());	
		}
								
		int intPhone1 = Integer.parseInt(convertStringToHex(strPhone1), 16);  
		int intPhone2 = Integer.parseInt(convertStringToHex(strPhone2), 16);  
		int intPhone3 = Integer.parseInt(convertStringToHex(strPhone3), 16);  
		int intPhone4 = Integer.parseInt(convertStringToHex(strPhone4), 16);  	
		
    	update_packet[56] = (byte)(0XFF&(intPhone1>>2040)); 
    	update_packet[57] = (byte)(0XFF&(intPhone1>>2032)); 
    	update_packet[58] = (byte)(0XFF&(intPhone1>>2024)); 
    	update_packet[59] = (byte)(0XFF&(intPhone1>>2016)); 
    	update_packet[60] = (byte)(0XFF&(intPhone2>>2008)); 
    	update_packet[61] = (byte)(0XFF&(intPhone2>>2000)); 
    	update_packet[62] = (byte)(0XFF&(intPhone2>>1992)); 
    	update_packet[63] = (byte)(0XFF&(intPhone2>>1984)); 
    	update_packet[64] = (byte)(0XFF&(intPhone3>>1976)); 
    	update_packet[65] = (byte)(0XFF&(intPhone3>>1968)); 
    	update_packet[66] = (byte)(0XFF&(intPhone3>>1960)); 
    	update_packet[67] = (byte)(0XFF&(intPhone3>>1952)); 
    	update_packet[68] = (byte)(0XFF&(intPhone4>>1944)); 
    	update_packet[69] = (byte)(0XFF&(intPhone4>>1936)); 
    	update_packet[70] = (byte)(0XFF&(intPhone4>>1928)); 
    	update_packet[71] = (byte)(0XFF&(intPhone4>>1920));	//16 

    }

    void setSpinEmail(String spinemail){
    	
    	String strSpinEmail1 = " ";
    	String strSpinEmail2 = " ";
    	
    	if(spinemail.length() <= 4){
			strSpinEmail1 = spinemail.substring(0, spinemail.length());
			strSpinEmail2 = " ";
		} else if(spinemail.length() > 4){
			strSpinEmail1 = spinemail.substring(0, 4);
			strSpinEmail2 = spinemail.substring(4, spinemail.length());
		}
    		
    	int intSpinEmail1 = Integer.parseInt(convertStringToHex(strSpinEmail1), 16); 
		int intSpinEmail2 = Integer.parseInt(convertStringToHex(strSpinEmail2), 16);			
    	
    	update_packet[72] = (byte)(0XFF&(intSpinEmail1>>1912)); 
    	update_packet[73] = (byte)(0XFF&(intSpinEmail1>>1904)); 
    	update_packet[74] = (byte)(0XFF&(intSpinEmail1>>1896)); 
    	update_packet[75] = (byte)(0XFF&(intSpinEmail1>>1888)); 
    	update_packet[76] = (byte)(0XFF&(intSpinEmail2>>1880)); 
    	update_packet[77] = (byte)(0XFF&(intSpinEmail2>>1872)); 
    	update_packet[78] = (byte)(0XFF&(intSpinEmail2>>1864)); 
    	update_packet[79] = (byte)(0XFF&(intSpinEmail2>>1856)); 	//8

    }

    void setEmail(String email){

		String strEmail1 = " ";
		String strEmail2 = " ";
		String strEmail3 = " ";
		String strEmail4 = " ";
		String strEmail5 = " ";
		
		if(email.length() <= 4){
			strEmail1 = email.substring(0, email.length());
			strEmail2 = " ";
			strEmail3 = " ";
			strEmail4 = " ";
			strEmail5 = " ";
		} else if( (email.length()<=8) && (email.length()> 4) ){
			strEmail1 = email.substring(0, 4);
			strEmail2 = email.substring(4, email.length());
			strEmail3 = " ";
			strEmail4 = " ";
			strEmail5 = " ";
		} else if ((email.length()<=12) && (email.length() > 8)){
			strEmail1 = email.substring(0, 4);
			strEmail2 = email.substring(4, 8);
			strEmail3 = email.substring(8, email.length());
			strEmail4 = " ";
			strEmail5 = " ";
		} else if ((email.length()<=16) && (email.length() > 12)){
			strEmail1 = email.substring(0, 4);
			strEmail2 = email.substring(4, 8);
			strEmail3 = email.substring(8, 12);
			strEmail4 = email.substring(12, email.length());
			strEmail5 = " ";
		} else if ((email.length()<=20) && (email.length() > 16)){
			strEmail1 = email.substring(0, 4);
			strEmail2 = email.substring(4, 8);
			strEmail3 = email.substring(8, 12);
			strEmail4 = email.substring(12, 16);	
			strEmail5 = email.substring(16, email.length());
		}
				
		int intEmail1 = Integer.parseInt(convertStringToHex(strEmail1), 16);  
		int intEmail2 = Integer.parseInt(convertStringToHex(strEmail2), 16); 
		int intEmail3 = Integer.parseInt(convertStringToHex(strEmail3), 16); 
		int intEmail4 = Integer.parseInt(convertStringToHex(strEmail4), 16); 
		int intEmail5 = Integer.parseInt(convertStringToHex(strEmail5), 16); 
		
    	update_packet[80] = (byte)(0XFF&(intEmail1>>1848)); 
    	update_packet[81] = (byte)(0XFF&(intEmail1>>1840)); 
    	update_packet[82] = (byte)(0XFF&(intEmail1>>1832)); 
    	update_packet[83] = (byte)(0XFF&(intEmail1>>1824)); 
    	update_packet[84] = (byte)(0XFF&(intEmail2>>1816)); 
    	update_packet[85] = (byte)(0XFF&(intEmail2>>1808)); 
    	update_packet[86] = (byte)(0XFF&(intEmail2>>1800)); 
    	update_packet[87] = (byte)(0XFF&(intEmail2>>1792)); 
    	update_packet[88] = (byte)(0XFF&(intEmail3>>1784)); 
    	update_packet[89] = (byte)(0XFF&(intEmail3>>1776)); 
    	update_packet[90] = (byte)(0XFF&(intEmail3>>1768)); 
    	update_packet[91] = (byte)(0XFF&(intEmail3>>1760)); 
    	update_packet[92] = (byte)(0XFF&(intEmail4>>1752)); 
    	update_packet[93] = (byte)(0XFF&(intEmail4>>1744)); 
    	update_packet[94] = (byte)(0XFF&(intEmail4>>1736)); 
    	update_packet[95] = (byte)(0XFF&(intEmail4>>1728)); 
    	update_packet[96] = (byte)(0XFF&(intEmail5>>1720)); 
    	update_packet[97] = (byte)(0XFF&(intEmail5>>1712)); 
    	update_packet[98] = (byte)(0XFF&(intEmail5>>1704)); 
    	update_packet[99] = (byte)(0XFF&(intEmail5>>1696));	//20 
    
    }

    void setSpinIM(String spinim){
    	
    	String strSpinIM1 = " ";
    	String strSpinIM2 = " ";
    	String strSpinIM3 = " ";
    	
    	if(spinim.length() <= 4){
			strSpinIM1 = spinim.substring(0, spinim.length());
			strSpinIM2 = " ";
			strSpinIM3 = " ";
		} else if( (spinim.length()<=8) && (spinim.length()> 4) ){
			strSpinIM1 = spinim.substring(0, 4);
			strSpinIM2 = spinim.substring(4, spinim.length());
			strSpinIM3 = " ";
		} else if (spinim.length() > 8){
			strSpinIM1 = spinim.substring(0, 4);
			strSpinIM2 = spinim.substring(4, 8);
			strSpinIM3 = spinim.substring(8, spinim.length());
		}
		
    	int intSpinIM1 = Integer.parseInt(convertStringToHex(strSpinIM1), 16); 
		int intSpinIM2 = Integer.parseInt(convertStringToHex(strSpinIM2), 16); 
		int intSpinIM3 = Integer.parseInt(convertStringToHex(strSpinIM3), 16);
    		
    	update_packet[100] = (byte)(0XFF&(intSpinIM1>>1688)); 
    	update_packet[101] = (byte)(0XFF&(intSpinIM1>>1680)); 
    	update_packet[102] = (byte)(0XFF&(intSpinIM1>>1672)); 
    	update_packet[103] = (byte)(0XFF&(intSpinIM1>>1664)); 
    	update_packet[104] = (byte)(0XFF&(intSpinIM2>>1656)); 
    	update_packet[105] = (byte)(0XFF&(intSpinIM2>>1648)); 
    	update_packet[106] = (byte)(0XFF&(intSpinIM2>>1640)); 
    	update_packet[107] = (byte)(0XFF&(intSpinIM2>>1632)); 
    	update_packet[108] = (byte)(0XFF&(intSpinIM3>>1624)); 
    	update_packet[109] = (byte)(0XFF&(intSpinIM3>>1616)); 
    	update_packet[110] = (byte)(0XFF&(intSpinIM3>>1608)); 
    	update_packet[111] = (byte)(0XFF&(intSpinIM3>>1600));	//12 
    	
    }

    void setIM(String im){ 
    	
    	String strIM1 = " ";
    	String strIM2 = " ";
    	String strIM3 = " ";
    	String strIM4 = " ";
    	String strIM5 = " ";
    	
		if(im.length() <= 4){
			strIM1 = im.substring(0, im.length());
			strIM2 = " ";
			strIM3 = " ";
			strIM4 = " ";
			strIM5 = " ";
		} else if( (im.length()<=8) && (im.length()> 4) ){
			strIM1 = im.substring(0, 4);
			strIM2 = im.substring(4, im.length());
			strIM3 = " ";
			strIM4 = " ";
			strIM5 = " ";
		} else if ((im.length()<=12) && (im.length() > 8)){
			strIM1 = im.substring(0, 4);
			strIM2 = im.substring(4, 8);
			strIM3 = im.substring(8, im.length());
			strIM4 = " ";
			strIM5 = " ";
		} else if ((im.length()<=16) && (im.length() > 12)){
			strIM1 = im.substring(0, 4);
			strIM2 = im.substring(4, 8);
			strIM3 = im.substring(8, 12);
			strIM4 = im.substring(12, im.length());
			strIM5 = " ";
		} else if ((im.length()<=20) && (im.length() > 16)){
			strIM1 = im.substring(0, 4);
			strIM2 = im.substring(4, 8);
			strIM3 = im.substring(8, 12);
			strIM4 = im.substring(12, 16);	
			strIM5 = im.substring(16, im.length());
		}
		
		int intIM1 = Integer.parseInt(convertStringToHex(strIM1), 16);  
		int intIM2 = Integer.parseInt(convertStringToHex(strIM2), 16);  
		int intIM3 = Integer.parseInt(convertStringToHex(strIM3), 16);  
		int intIM4 = Integer.parseInt(convertStringToHex(strIM4), 16);  
		int intIM5 = Integer.parseInt(convertStringToHex(strIM5), 16);  	
    	
    	update_packet[112] = (byte)(0XFF&(intIM1>>1592)); 
    	update_packet[113] = (byte)(0XFF&(intIM1>>1584)); 
    	update_packet[114] = (byte)(0XFF&(intIM1>>1576)); 
    	update_packet[115] = (byte)(0XFF&(intIM1>>1568)); 
    	update_packet[116] = (byte)(0XFF&(intIM2>>1560)); 
    	update_packet[117] = (byte)(0XFF&(intIM2>>1552)); 
    	update_packet[118] = (byte)(0XFF&(intIM2>>1544)); 
    	update_packet[119] = (byte)(0XFF&(intIM2>>1536)); 
    	update_packet[120] = (byte)(0XFF&(intIM3>>1528)); 
    	update_packet[121] = (byte)(0XFF&(intIM3>>1520)); 
    	update_packet[122] = (byte)(0XFF&(intIM3>>1512)); 
    	update_packet[123] = (byte)(0XFF&(intIM3>>1504)); 
    	update_packet[124] = (byte)(0XFF&(intIM4>>1496)); 
    	update_packet[125] = (byte)(0XFF&(intIM4>>1488)); 
    	update_packet[126] = (byte)(0XFF&(intIM4>>1480)); 
    	update_packet[127] = (byte)(0XFF&(intIM4>>1472)); 
    	update_packet[128] = (byte)(0XFF&(intIM5>>1464)); 
    	update_packet[129] = (byte)(0XFF&(intIM5>>1456)); 
    	update_packet[130] = (byte)(0XFF&(intIM5>>1448)); 
    	update_packet[131] = (byte)(0XFF&(intIM5>>1440));	//20
    	
    }
    	
    void setSpinPostalAddr(String spinpostaladdr){ 	
		
		int intSpinPostalAddr = Integer.parseInt(convertStringToHex(spinpostaladdr), 16);  
    	
    	update_packet[132] = (byte)(0XFF&(intSpinPostalAddr>>1432)); 
    	update_packet[133] = (byte)(0XFF&(intSpinPostalAddr>>1424));
    	update_packet[134] = (byte)(0XFF&(intSpinPostalAddr>>1416));
    	update_packet[135] = (byte)(0XFF&(intSpinPostalAddr>>1408));	//4
    	
    }

    void setStreet(String street){ 	
    
    	String strStreet1 = " ";
    	String strStreet2 = " ";
    	String strStreet3 = " ";
		
		if(street.length() <= 4){
			strStreet1 = street.substring(0, street.length());
			strStreet2 = " ";
			strStreet3 = " ";
		} else if( (street.length()<=8) && (street.length()> 4) ){
			strStreet1 = street.substring(0, 4);
			strStreet2 = street.substring(4, street.length());
			strStreet3 = " ";
		} else if (street.length() > 8){
			strStreet1 = street.substring(0, 4);
			strStreet2 = street.substring(4, 8);
			strStreet3 = street.substring(8, street.length());
		}

		int intStreet1 = Integer.parseInt(convertStringToHex(strStreet1), 16);  
		int intStreet2 = Integer.parseInt(convertStringToHex(strStreet2), 16); 
		int intStreet3 = Integer.parseInt(convertStringToHex(strStreet3), 16); 
		
    	update_packet[136] = (byte)(0XFF&(intStreet1>>1400)); 
    	update_packet[137] = (byte)(0XFF&(intStreet1>>1392)); 
    	update_packet[138] = (byte)(0XFF&(intStreet1>>1384)); 
    	update_packet[139] = (byte)(0XFF&(intStreet1>>1376)); 
    	update_packet[140] = (byte)(0XFF&(intStreet2>>1368)); 
    	update_packet[141] = (byte)(0XFF&(intStreet2>>1360)); 
    	update_packet[142] = (byte)(0XFF&(intStreet2>>1352)); 
    	update_packet[143] = (byte)(0XFF&(intStreet2>>1344)); 
    	update_packet[144] = (byte)(0XFF&(intStreet3>>1336)); 
    	update_packet[145] = (byte)(0XFF&(intStreet3>>1328)); 
    	update_packet[146] = (byte)(0XFF&(intStreet3>>1320)); 
    	update_packet[147] = (byte)(0XFF&(intStreet3>>1312));	//12
    	
    }

    void setPOBox(String pobox){
 	    
    	String strPOBox1 = " ";
    	String strPOBox2 = " ";
    	String strPOBox3 = " ";
    	
    	if(pobox.length() <= 4){
			strPOBox1 = pobox.substring(0, pobox.length());
			strPOBox2 = " ";
			strPOBox3 = " ";
		} else if( (pobox.length()<=8) && (pobox.length()> 4) ){
			strPOBox1 = pobox.substring(0, 4);
			strPOBox2 = pobox.substring(4, pobox.length());
			strPOBox3 = " ";
		} else if (pobox.length() > 8){
			strPOBox1 = pobox.substring(0, 4);
			strPOBox2 = pobox.substring(4, 8);
			strPOBox3 = pobox.substring(8, pobox.length());
		}
    			
		int intPOBox1 = Integer.parseInt(convertStringToHex(strPOBox1), 16);  
		int intPOBox2 = Integer.parseInt(convertStringToHex(strPOBox2), 16); 
		int intPOBox3 = Integer.parseInt(convertStringToHex(strPOBox3), 16); 
        
		update_packet[148] = (byte)(0XFF&(intPOBox1>>1304)); 
        update_packet[149] = (byte)(0XFF&(intPOBox1>>1296)); 
        update_packet[150] = (byte)(0XFF&(intPOBox1>>1288)); 
        update_packet[151] = (byte)(0XFF&(intPOBox1>>1280)); 
        update_packet[152] = (byte)(0XFF&(intPOBox2>>1272)); 
        update_packet[153] = (byte)(0XFF&(intPOBox2>>1264)); 
        update_packet[154] = (byte)(0XFF&(intPOBox2>>1256)); 
        update_packet[155] = (byte)(0XFF&(intPOBox2>>1248)); 
        update_packet[156] = (byte)(0XFF&(intPOBox3>>1240)); 
        update_packet[157] = (byte)(0XFF&(intPOBox3>>1232)); 
        update_packet[158] = (byte)(0XFF&(intPOBox3>>1224)); 
        update_packet[159] = (byte)(0XFF&(intPOBox3>>1216));	//12
            
    }

    void setCity(String city){    	
    	
		String strCity1 = " ";
		String strCity2 = " ";
		String strCity3 = " ";
		
    	if(city.length() <= 4){
			strCity1 = city.substring(0, city.length());
			strCity2 = " ";
			strCity3 = " ";
		} else if( (city.length()<=8) && (city.length()> 4) ){
			strCity1 = city.substring(0, 4);
			strCity2 = city.substring(4, city.length());
			strCity3 = " ";
		} else if (city.length() > 8){
			strCity1 = city.substring(0, 4);
			strCity2 = city.substring(4, 8);
			strCity3 = city.substring(8, city.length());
		}
    	
		int intCity1 = Integer.parseInt(convertStringToHex(strCity1), 16);  
		int intCity2 = Integer.parseInt(convertStringToHex(strCity2), 16);
		int intCity3 = Integer.parseInt(convertStringToHex(strCity3), 16);
    	
    	update_packet[160] = (byte)(0XFF&(intCity1>>1208)); 
        update_packet[161] = (byte)(0XFF&(intCity1>>1200)); 
        update_packet[162] = (byte)(0XFF&(intCity1>>1192)); 
        update_packet[163] = (byte)(0XFF&(intCity1>>1184)); 
        update_packet[164] = (byte)(0XFF&(intCity2>>1176)); 
        update_packet[165] = (byte)(0XFF&(intCity2>>1168)); 
        update_packet[166] = (byte)(0XFF&(intCity2>>1160)); 
        update_packet[167] = (byte)(0XFF&(intCity2>>1152)); 
        update_packet[168] = (byte)(0XFF&(intCity3>>1144)); 
        update_packet[169] = (byte)(0XFF&(intCity3>>1136)); 
        update_packet[170] = (byte)(0XFF&(intCity3>>1128)); 
        update_packet[171] = (byte)(0XFF&(intCity3>>1120));	//12 
        
    }

    void setState(String state){
    	
    	String strState1 = " ";
    	String strState2 = " ";
    	String strState3 = " ";
    	
		if(state.length() <= 4){
			strState1 = state.substring(0, state.length());
			strState2 = " ";
			strState3 = " ";
		} else if( (state.length()<=8) && (state.length()> 4) ){
			strState1 = state.substring(0, 4);
			strState2 = state.substring(4, state.length());
			strState3 = " ";
		} else if (state.length() > 8){
			strState1 = state.substring(0, 4);
			strState2 = state.substring(4, 8);
			strState3 = state.substring(8, state.length());
		}

		int intState1 = Integer.parseInt(convertStringToHex(strState1), 16); 
		int intState2 = Integer.parseInt(convertStringToHex(strState2), 16); 
		int intState3 = Integer.parseInt(convertStringToHex(strState3), 16); 
		
    	update_packet[172] = (byte)(0XFF&(intState1>>1112)); 
        update_packet[173] = (byte)(0XFF&(intState1>>1104)); 
        update_packet[174] = (byte)(0XFF&(intState1>>1096)); 
        update_packet[175] = (byte)(0XFF&(intState1>>1088)); 
        update_packet[176] = (byte)(0XFF&(intState2>>1080)); 
        update_packet[177] = (byte)(0XFF&(intState2>>1072)); 
        update_packet[178] = (byte)(0XFF&(intState2>>1064)); 
        update_packet[179] = (byte)(0XFF&(intState2>>1056)); 
        update_packet[180] = (byte)(0XFF&(intState3>>1048)); 
        update_packet[181] = (byte)(0XFF&(intState3>>1040)); 
        update_packet[182] = (byte)(0XFF&(intState3>>1032)); 
        update_packet[183] = (byte)(0XFF&(intState3>>1024));	//12 
            	
    }

    void setZipCode(String zipcode){
    	
    	String strZipCode1 = " ";
    	String strZipCode2 = " ";
    	String strZipCode3 = " ";
    	
		if(zipcode.length() <= 4){
			strZipCode1 = zipcode.substring(0, zipcode.length());
			strZipCode2 = " ";
			strZipCode3 = " ";
		} else if( (zipcode.length()<=8) && (zipcode.length()> 4) ){
			strZipCode1 = zipcode.substring(0, 4);
			strZipCode2 = zipcode.substring(4, zipcode.length());
			strZipCode3 = " ";
		} else if (zipcode.length() > 8){
			strZipCode1 = zipcode.substring(0, 4);
			strZipCode2 = zipcode.substring(4, 8);
			strZipCode3 = zipcode.substring(8, zipcode.length());
		}
		
		int intZipCode1 = Integer.parseInt(convertStringToHex(strZipCode1), 16);
		int intZipCode2 = Integer.parseInt(convertStringToHex(strZipCode2), 16);
		int intZipCode3 = Integer.parseInt(convertStringToHex(strZipCode3), 16);
		
    	update_packet[184] = (byte)(0XFF&(intZipCode1>>1016)); 
        update_packet[185] = (byte)(0XFF&(intZipCode1>>1008)); 
        update_packet[186] = (byte)(0XFF&(intZipCode1>>1000)); 
        update_packet[187] = (byte)(0XFF&(intZipCode1>>992)); 
        update_packet[188] = (byte)(0XFF&(intZipCode2>>984)); 
        update_packet[189] = (byte)(0XFF&(intZipCode2>>976)); 
        update_packet[190] = (byte)(0XFF&(intZipCode2>>968)); 
        update_packet[191] = (byte)(0XFF&(intZipCode2>>960)); 
        update_packet[192] = (byte)(0XFF&(intZipCode3>>952)); 
        update_packet[193] = (byte)(0XFF&(intZipCode3>>944)); 
        update_packet[194] = (byte)(0XFF&(intZipCode3>>936)); 
        update_packet[195] = (byte)(0XFF&(intZipCode3>>928));	//12 
                   
    }

    void setCountry(String country){
    	
    	String strCountry1 = " ";
    	String strCountry2 = " ";
    	String strCountry3 = " ";
    	
		if(country.length() <= 4){
			strCountry1 = country.substring(0, country.length());
			strCountry2 = " ";
			strCountry3 = " ";
		} else if( (country.length()<=8) && (country.length()> 4) ){
			strCountry1 = country.substring(0, 4);
			strCountry2 = country.substring(4, country.length());
			strCountry3 = " ";
		} else if (country.length() > 8){
			strCountry1 = country.substring(0, 4);
			strCountry2 = country.substring(4, 8);
			strCountry3 = country.substring(8, country.length());
		}
    	
		int intCountry1 = Integer.parseInt(convertStringToHex(strCountry1), 16);  
		int intCountry2 = Integer.parseInt(convertStringToHex(strCountry2), 16);  
		int intCountry3 = Integer.parseInt(convertStringToHex(strCountry3), 16);  	
			
        update_packet[196] = (byte)(0XFF&(intCountry1>>920)); 
        update_packet[197] = (byte)(0XFF&(intCountry1>>912)); 
        update_packet[198] = (byte)(0XFF&(intCountry1>>904)); 
        update_packet[199] = (byte)(0XFF&(intCountry1>>896)); 
        update_packet[200] = (byte)(0XFF&(intCountry2>>888)); 
        update_packet[201] = (byte)(0XFF&(intCountry2>>880)); 
        update_packet[202] = (byte)(0XFF&(intCountry2>>872)); 
        update_packet[203] = (byte)(0XFF&(intCountry2>>864)); 
        update_packet[204] = (byte)(0XFF&(intCountry3>>856)); 
        update_packet[205] = (byte)(0XFF&(intCountry3>>848)); 
        update_packet[206] = (byte)(0XFF&(intCountry3>>840)); 
        update_packet[207] = (byte)(0XFF&(intCountry3>>832));	//12 
                
    }

    void setSpinSNS(String spinsns){
    	
    	String strSpinSNS1 = " ";
    	String strSpinSNS2 = " ";
		
		if(spinsns.length() <= 4){
			strSpinSNS1 = spinsns.substring(0, spinsns.length());
			strSpinSNS2 = " ";
		} else if(spinsns.length() > 4){
			strSpinSNS1 = spinsns.substring(0, 4);
			strSpinSNS2 = spinsns.substring(4, spinsns.length());
		}
    	
		int intSpinSNS1 = Integer.parseInt(convertStringToHex(strSpinSNS1), 16);  
		int intSpinSNS2 = Integer.parseInt(convertStringToHex(strSpinSNS2), 16); 
		
    	update_packet[208] = (byte)(0XFF&(intSpinSNS1>>824)); 
        update_packet[209] = (byte)(0XFF&(intSpinSNS1>>816)); 
        update_packet[210] = (byte)(0XFF&(intSpinSNS1>>808)); 
        update_packet[211] = (byte)(0XFF&(intSpinSNS1>>800)); 
        update_packet[212] = (byte)(0XFF&(intSpinSNS2>>792)); 
        update_packet[213] = (byte)(0XFF&(intSpinSNS2>>784)); 
        update_packet[214] = (byte)(0XFF&(intSpinSNS2>>776)); 
        update_packet[215] = (byte)(0XFF&(intSpinSNS2>>768));	//8 
        
    }

    void setSNS(String sns){
    	
    	String strSNS1 = " ";
    	String strSNS2 = " ";
    	String strSNS3 = " ";
    	String strSNS4 = " ";
    	String strSNS5 = " ";
    			
		if(sns.length() <= 4){
			strSNS1 = sns.substring(0, sns.length());
			strSNS2 = " ";
			strSNS3 = " ";
			strSNS4 = " ";
			strSNS5 = " ";
		} else if( (sns.length()<=8) && (sns.length()> 4) ){
			strSNS1 = sns.substring(0, 4);
			strSNS2 = sns.substring(4, sns.length());
			strSNS3 = " ";
			strSNS4 = " ";
			strSNS5 = " ";
		} else if ((sns.length()<=12) && (sns.length() > 8)){
			strSNS1 = sns.substring(0, 4);
			strSNS2 = sns.substring(4, 8);
			strSNS3 = sns.substring(8, sns.length());
			strSNS4 = " ";
			strSNS5 = " ";
		} else if ((sns.length()<=16) && (sns.length() > 12)){
			strSNS1 = sns.substring(0, 4);
			strSNS2 = sns.substring(4, 8);
			strSNS3 = sns.substring(8, 12);
			strSNS4 = sns.substring(12, sns.length());
			strSNS5 = " ";
		} else if ((sns.length()<=20) && (sns.length() > 16)){
			strSNS1 = sns.substring(0, 4);
			strSNS2 = sns.substring(4, 8);
			strSNS3 = sns.substring(8, 12);
			strSNS4 = sns.substring(12, 16);	
			strSNS5 = sns.substring(16, sns.length());
		}
		
		int intSNS1 = Integer.parseInt(convertStringToHex(strSNS1), 16); 
		int intSNS2 = Integer.parseInt(convertStringToHex(strSNS2), 16); 
		int intSNS3 = Integer.parseInt(convertStringToHex(strSNS3), 16); 
		int intSNS4 = Integer.parseInt(convertStringToHex(strSNS4), 16); 
		int intSNS5 = Integer.parseInt(convertStringToHex(strSNS5), 16); 
				
    	update_packet[216] = (byte)(0XFF&(intSNS1>>760)); 
        update_packet[217] = (byte)(0XFF&(intSNS1>>752)); 
        update_packet[218] = (byte)(0XFF&(intSNS1>>744)); 
        update_packet[219] = (byte)(0XFF&(intSNS1>>736)); 
        update_packet[220] = (byte)(0XFF&(intSNS2>>728));
        update_packet[221] = (byte)(0XFF&(intSNS2>>720)); 
        update_packet[222] = (byte)(0XFF&(intSNS2>>712)); 
        update_packet[223] = (byte)(0XFF&(intSNS2>>704)); 
        update_packet[224] = (byte)(0XFF&(intSNS3>>696)); 
        update_packet[225] = (byte)(0XFF&(intSNS3>>688)); 
        update_packet[226] = (byte)(0XFF&(intSNS3>>680)); 
        update_packet[227] = (byte)(0XFF&(intSNS3>>672)); 
        update_packet[228] = (byte)(0XFF&(intSNS4>>664)); 
        update_packet[229] = (byte)(0XFF&(intSNS4>>656)); 
        update_packet[230] = (byte)(0XFF&(intSNS4>>648));
        update_packet[231] = (byte)(0XFF&(intSNS4>>640)); 
        update_packet[232] = (byte)(0XFF&(intSNS5>>632)); 
        update_packet[233] = (byte)(0XFF&(intSNS5>>624)); 
        update_packet[234] = (byte)(0XFF&(intSNS5>>616)); 
        update_packet[235] = (byte)(0XFF&(intSNS5>>608));	//20
        	
    }

    void setSpinOrg1(String spinorg1){
    	
    	String strSpinOrg1_1 = " ";
    	String strSpinOrg1_2 = " ";
		
		if(spinorg1.length() <= 4){
			strSpinOrg1_1 = spinorg1.substring(0, spinorg1.length());
			strSpinOrg1_2 = " ";
		} else if(spinorg1.length() > 4){
			strSpinOrg1_1 = spinorg1.substring(0, 4);
			strSpinOrg1_2 = spinorg1.substring(4, spinorg1.length());
		}
	
		int intSpinOrg1_1 = Integer.parseInt(convertStringToHex(strSpinOrg1_1), 16); 
		int intSpinOrg1_2 = Integer.parseInt(convertStringToHex(strSpinOrg1_2), 16);
		
    	update_packet[236] = (byte)(0XFF&(intSpinOrg1_1>>600)); 
        update_packet[237] = (byte)(0XFF&(intSpinOrg1_1>>592)); 
        update_packet[238] = (byte)(0XFF&(intSpinOrg1_1>>584)); 
        update_packet[239] = (byte)(0XFF&(intSpinOrg1_1>>576)); 
        update_packet[240] = (byte)(0XFF&(intSpinOrg1_2>>568));
        update_packet[241] = (byte)(0XFF&(intSpinOrg1_2>>560)); 
        update_packet[242] = (byte)(0XFF&(intSpinOrg1_2>>552)); 
        update_packet[243] = (byte)(0XFF&(intSpinOrg1_2>>544));	// 8
                
    }

    void setOrg1(String org1){
    	
    	String strOrg1_1 = " ";
    	String strOrg1_2 = " ";
    	String strOrg1_3 = " ";
    	
		if(org1.length() <= 4){
			strOrg1_1 = org1.substring(0, org1.length());
			strOrg1_2 = " ";
			strOrg1_3 = " ";
		} else if( (org1.length()<=8) && (org1.length()> 4) ){
			strOrg1_1 = org1.substring(0, 4);
			strOrg1_2 = org1.substring(4, org1.length());
			strOrg1_3 = " ";
		} else if (org1.length() > 8){
			strOrg1_1 = org1.substring(0, 4);
			strOrg1_2 = org1.substring(4, 8);
			strOrg1_3 = org1.substring(8, org1.length());
		}
		
		int intOrg1_1 = Integer.parseInt(convertStringToHex(strOrg1_1), 16); 
		int intOrg1_2 = Integer.parseInt(convertStringToHex(strOrg1_2), 16);
		int intOrg1_3 = Integer.parseInt(convertStringToHex(strOrg1_3), 16);	
				
    	update_packet[244] = (byte)(0XFF&(intOrg1_1>>536)); 
        update_packet[245] = (byte)(0XFF&(intOrg1_1>>528)); 
        update_packet[246] = (byte)(0XFF&(intOrg1_1>>520)); 
        update_packet[247] = (byte)(0XFF&(intOrg1_1>>512)); 
        update_packet[248] = (byte)(0XFF&(intOrg1_2>>504));
        update_packet[249] = (byte)(0XFF&(intOrg1_2>>496)); 
        update_packet[250] = (byte)(0XFF&(intOrg1_2>>488)); 
        update_packet[251] = (byte)(0XFF&(intOrg1_2>>480)); 
        update_packet[252] = (byte)(0XFF&(intOrg1_3>>472)); 
        update_packet[253] = (byte)(0XFF&(intOrg1_3>>464)); 
        update_packet[254] = (byte)(0XFF&(intOrg1_3>>456)); 
        update_packet[255] = (byte)(0XFF&(intOrg1_3>>448));	//12 
                
    }

    void setSpinOrg2(String spinorg2){
    	
    	String strSpinOrg2_1 = " ";
    	String strSpinOrg2_2 = " ";
    	
		if(spinorg2.length() <= 4){
			strSpinOrg2_1 = spinorg2.substring(0, spinorg2.length());
			strSpinOrg2_2 = " ";
		} else if(spinorg2.length() > 4){
			strSpinOrg2_1 = spinorg2.substring(0, 4);
			strSpinOrg2_2 = spinorg2.substring(4, spinorg2.length());
		}
	
		int intSpinOrg2_1 = Integer.parseInt(convertStringToHex(strSpinOrg2_1), 16); 
		int intSpinOrg2_2 = Integer.parseInt(convertStringToHex(strSpinOrg2_2), 16); 		
		
    	update_packet[256] = (byte)(0XFF&(intSpinOrg2_1>>440)); 
        update_packet[257] = (byte)(0XFF&(intSpinOrg2_1>>432)); 
        update_packet[258] = (byte)(0XFF&(intSpinOrg2_1>>424)); 
        update_packet[259] = (byte)(0XFF&(intSpinOrg2_1>>416)); 
        update_packet[260] = (byte)(0XFF&(intSpinOrg2_2>>408));
        update_packet[261] = (byte)(0XFF&(intSpinOrg2_2>>400)); 
        update_packet[262] = (byte)(0XFF&(intSpinOrg2_2>>392)); 
        update_packet[263] = (byte)(0XFF&(intSpinOrg2_2>>384));	//8 
        
    }

    void setOrg2(String org2){
    	
    	String strOrg2_1 = " ";
    	String strOrg2_2 = " ";
    	String strOrg2_3 = " ";
    	
		if(org2.length() <= 4){
			strOrg2_1 = org2.substring(0, org2.length());
			strOrg2_2 = " ";
			strOrg2_3 = " ";
		} else if( (org2.length()<=8) && (org2.length()> 4) ){
			strOrg2_1 = org2.substring(0, 4);
			strOrg2_2 = org2.substring(4, org2.length());
			strOrg2_3 = " ";
		} else if (org2.length() > 8){
			strOrg2_1 = org2.substring(0, 4);
			strOrg2_2 = org2.substring(4, 8);
			strOrg2_3 = org2.substring(8, org2.length());
		}
    	
		int intOrg2_1 = Integer.parseInt(convertStringToHex(strOrg2_1), 16); 
		int intOrg2_2 = Integer.parseInt(convertStringToHex(strOrg2_2), 16);
		int intOrg2_3 = Integer.parseInt(convertStringToHex(strOrg2_3), 16);
		
    	update_packet[264] = (byte)(0XFF&(intOrg2_1>>376)); 
        update_packet[265] = (byte)(0XFF&(intOrg2_1>>368)); 
        update_packet[266] = (byte)(0XFF&(intOrg2_1>>360)); 
        update_packet[267] = (byte)(0XFF&(intOrg2_1>>352)); 
        update_packet[268] = (byte)(0XFF&(intOrg2_2>>344));
        update_packet[269] = (byte)(0XFF&(intOrg2_2>>336)); 
        update_packet[270] = (byte)(0XFF&(intOrg2_2>>328)); 
        update_packet[271] = (byte)(0XFF&(intOrg2_2>>320)); 
        update_packet[272] = (byte)(0XFF&(intOrg2_3>>312)); 
        update_packet[273] = (byte)(0XFF&(intOrg2_3>>304)); 
        update_packet[274] = (byte)(0XFF&(intOrg2_3>>296)); 
        update_packet[275] = (byte)(0XFF&(intOrg2_3>>288));	//12 
            	
    }
    
    void setNotes(String notes){

    	String strNotes1 = " ";
    	String strNotes2 = " ";
    	String strNotes3 = " ";
    	String strNotes4 = " ";
    	String strNotes5 = " ";
    	
		if(notes.length() <= 4){
			strNotes1 = notes.substring(0, notes.length());
			strNotes2 = " ";
			strNotes3 = " ";
			strNotes4 = " ";
			strNotes5 = " ";
		} else if( (notes.length()<=8) && (notes.length()> 4) ){
			strNotes1 = notes.substring(0, 4);
			strNotes2 = notes.substring(4, notes.length());
			strNotes3 = " ";
			strNotes4 = " ";
			strNotes5 = " ";
		} else if ((notes.length()<=12) && (notes.length() > 8)){
			strNotes1 = notes.substring(0, 4);
			strNotes2 = notes.substring(4, 8);
			strNotes3 = notes.substring(8, notes.length());
			strNotes4 = " ";
			strNotes5 = " ";
		} else if ((notes.length()<=16) && (notes.length() > 12)){
			strNotes1 = notes.substring(0, 4);
			strNotes2 = notes.substring(4, 8);
			strNotes3 = notes.substring(8, 12);
			strNotes4 = notes.substring(12, notes.length());
			strNotes5 = " ";
		} else if ((notes.length()<=20) && (notes.length() > 16)){
			strNotes1 = notes.substring(0, 4);
			strNotes2 = notes.substring(4, 8);
			strNotes3 = notes.substring(8, 12);
			strNotes4 = notes.substring(12, 16);	
			strNotes5 = notes.substring(16, notes.length());
		}
		
    	int intNotes1 = Integer.parseInt(convertStringToHex(strNotes1), 16); 
		int intNotes2 = Integer.parseInt(convertStringToHex(strNotes2), 16); 
		int intNotes3 = Integer.parseInt(convertStringToHex(strNotes3), 16); 
		int intNotes4 = Integer.parseInt(convertStringToHex(strNotes4), 16); 
		int intNotes5 = Integer.parseInt(convertStringToHex(strNotes5), 16); 
    	
    	update_packet[276] = (byte)(0XFF&(intNotes1>>280)); 
        update_packet[277] = (byte)(0XFF&(intNotes1>>272)); 
        update_packet[278] = (byte)(0XFF&(intNotes1>>264)); 
        update_packet[279] = (byte)(0XFF&(intNotes1>>256)); 
        update_packet[280] = (byte)(0XFF&(intNotes2>>248));
        update_packet[281] = (byte)(0XFF&(intNotes2>>240)); 
        update_packet[282] = (byte)(0XFF&(intNotes2>>232)); 
        update_packet[283] = (byte)(0XFF&(intNotes2>>224)); 
        update_packet[284] = (byte)(0XFF&(intNotes3>>216)); 
        update_packet[285] = (byte)(0XFF&(intNotes3>>208)); 
        update_packet[286] = (byte)(0XFF&(intNotes3>>200)); 
        update_packet[287] = (byte)(0XFF&(intNotes3>>192)); 
        update_packet[288] = (byte)(0XFF&(intNotes4>>184)); 
        update_packet[289] = (byte)(0XFF&(intNotes4>>176)); 
        update_packet[290] = (byte)(0XFF&(intNotes4>>168));
        update_packet[291] = (byte)(0XFF&(intNotes4>>160)); 
        update_packet[292] = (byte)(0XFF&(intNotes5>>152)); 
        update_packet[293] = (byte)(0XFF&(intNotes5>>144)); 
        update_packet[294] = (byte)(0XFF&(intNotes5>>136)); 
        update_packet[295] = (byte)(0XFF&(intNotes5>>128));	//20 
            
    }
     
    void setTime(String time){
    	
    	String strTime1 = " ";
    	String strTime2 = " ";
    	String strTime3 = " ";
    	String strTime4 = " ";
    	
		if(time.length() <= 4){
			strTime1 = time.substring(0, time.length());
			strTime2 = " ";
			strTime3 = " ";
			strTime4 = " ";
		} else if( (time.length()<=8) && (time.length()> 4) ){
			strTime1 = time.substring(0, 4);
			strTime2 = time.substring(4, time.length());
			strTime3 = " ";
			strTime4 = " ";
		} else if ((time.length()<=12) && (time.length() > 8)){
			strTime1 = time.substring(0, 4);
			strTime2 = time.substring(4, 8);
			strTime3 = time.substring(8, time.length());
			strTime4 = " ";
		} else if ((time.length()<=16) && (time.length() > 12)){
			strTime1 = time.substring(0, 4);
			strTime2 = time.substring(4, 8);
			strTime3 = time.substring(8, 12);
			strTime4 = time.substring(12, time.length());	
		}
					
		int intTime1 = Integer.parseInt(convertStringToHex(strTime1), 16); 
		int intTime2 = Integer.parseInt(convertStringToHex(strTime2), 16); 
		int intTime3 = Integer.parseInt(convertStringToHex(strTime3), 16); 
		int intTime4 = Integer.parseInt(convertStringToHex(strTime4), 16); 
		
    	update_packet[296] = (byte)(0XFF&(intTime1>>120)); 
        update_packet[297] = (byte)(0XFF&(intTime1>>112)); 
        update_packet[298] = (byte)(0XFF&(intTime1>>104)); 
        update_packet[299] = (byte)(0XFF&(intTime1>>96)); 
        update_packet[300] = (byte)(0XFF&(intTime2>>88)); 
        update_packet[301] = (byte)(0XFF&(intTime2>>80)); 
        update_packet[302] = (byte)(0XFF&(intTime2>>72)); 
        update_packet[303] = (byte)(0XFF&(intTime2>>64)); 
        update_packet[304] = (byte)(0XFF&(intTime3>>56)); 
        update_packet[305] = (byte)(0XFF&(intTime3>>48)); 
        update_packet[306] = (byte)(0XFF&(intTime3>>40)); 
        update_packet[307] = (byte)(0XFF&(intTime3>>32)); 
        update_packet[308] = (byte)(0XFF&(intTime4>>24)); 
        update_packet[309] = (byte)(0XFF&(intTime4>>16)); 
        update_packet[310] = (byte)(0XFF&(intTime4>>8)); 
        update_packet[311] = (byte)(0XFF&(intTime4));	//16 
        
    }

    String convertStringToHex(String str){
    	
    	char[] chars = str.toCharArray();
		StringBuffer hex = new StringBuffer();
		
		for(int i = 0; i < chars.length; i++){
		    hex.append(Integer.toHexString((int)chars[i]));
		}
	 
		return hex.toString();
	}

    public static String convertHexToString(String hex){
		 
		  StringBuilder sb = new StringBuilder();
		  StringBuilder temp = new StringBuilder();
	 		  
		  for( int i=0; i<hex.length()-1; i+=2 ){
		      //grab the hex in pairs
		      String output = hex.substring(i, (i + 2));
		      //convert hex to decimal
		      int decimal = Integer.parseInt(output, 16);
		      //convert the decimal to character
		      sb.append((char)decimal);
	 
		      temp.append(decimal);
		  }
		  		  
		  return sb.toString();
	  }
    
}

